#pragma once
#include "ddthread3.h"

class HubAutoCapture :	public DDThread3
{
public:
	HubAutoCapture(void);
	~HubAutoCapture(void);

public:
	int Initialize();
	void UnInitialize();

public:
	int Start();
	int Stop();

public:
	int SetPLCEvent(bool bEvent = true);
	int SetRayEvent(bool bEvent = true);
	int SetAutoEvent(bool bEvent = true);

private:
	virtual int DDThdDispatch(HANDLE hExitEvent = NULL);

public:
	DWORD m_dwMoveCtrlReg;
	DWORD m_dwRayReg;
	DWORD m_dwCapReg;
	DWORD m_dwCheckHardDog;

private:
	DDCriticalSection m_Sect;

private:
	HANDLE m_hPLCEvent;
	HANDLE m_hRayEvent;
	HANDLE m_hAutoEvent;

	BOOL   m_bWorking;
};

extern HubAutoCapture *g_HubAutoCapture;
